#include "stdafx.h"
#include "PyInterface.h"
#include <Python.h>
#include <iostream>
//#pragma comment(lib,"python25.lib")

int sayHello()
{
	std::cout << "Hello" << std::endl;
	return 1;
}
static PyObject* SC_SayHello(PyObject* self, PyObject* args)
{
	const char* pStr = NULL;
	PyArg_ParseTuple(args,"s",&pStr);
	if (pStr)
	{
		std::cout << pStr << std::endl;
	}
	sayHello();
	Py_INCREF(Py_None);
	return Py_None;
}

static PyMethodDef SayHelloMethods[] = 
{
	{"sayHello",SC_SayHello,METH_VARARGS},
	{NULL,NULL,NULL,NULL}
};

PyMODINIT_FUNC initSayHello(void)
{
//	PyImport_AddModule("SayHello");
	Py_InitModule("SayHello",SayHelloMethods);
	//PyRun_SimpleString("a = \"123\";SayHello.sayHello(a+'45');print 200+300;");
	//PyTypeObject
}

